<?php

namespace App\Supports;

trait SingletonTrait
{
    /**
     * @var array
     */
    protected static array $instance = [];


    public static function getInstance()
    {
        $class = static::class;
        if (!isset(self::$instance[$class])) {
            self::$instance[$class] = new static();
        }

        return self::$instance[$class];
    }
}
